projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aeec97f
)
Add a new test for dom-search
author
Lars Ingebrigtsen
<larsi@gnus.org>
Mon, 9 Aug 2021 12:14:01 +0000
(14:14 +0200)
committer
Lars Ingebrigtsen
<larsi@gnus.org>
Mon, 9 Aug 2021 12:14:37 +0000
(14:14 +0200)
test/lisp/dom-tests.el
patch
|
blob
|
history
diff --git
a/test/lisp/dom-tests.el
b/test/lisp/dom-tests.el
index 0a0d783b8245d4089a5cdaf2343cf4be6a5eff30..b55982c1a15eba9c17210982f352feaee834ad67 100644
(file)
--- a/
test/lisp/dom-tests.el
+++ b/
test/lisp/dom-tests.el
@@
-209,5
+209,13
@@
child results in an error."
(dom-pp node t)
(should (equal (buffer-string) "(\"foo\" nil)")))))
+(ert-deftest dom-test-search ()
+ (let ((dom '(a nil (b nil (c nil)))))
+ (should (equal (dom-search dom (lambda (d) (eq (dom-tag d) 'a)))
+ (list dom)))
+ (should (equal (dom-search dom (lambda (d) (memq (dom-tag d) '(b c))))
+ (list (car (dom-children dom))
+ (car (dom-children (car (dom-children dom)))))))))
+
(provide 'dom-tests)
;;; dom-tests.el ends here